#pragma once
#include "SParser.h"
#include "SCoreStd.h"

struct	SScene
{
	int		firstFrame;
	int		lastFrame;
	int		frameSpeed;
	int		tickSperFrame;
};

struct	SSubMaterRialName
{
	TCHAR	subMaterialName[256];
};

struct	SMaterRial
{
	TCHAR						material_class_Type[256];
	TCHAR						diffuseBitmap[256];
	int							numSubmaterial;	
	vector<SSubMaterRialName>	submaterialInfo;
};

struct	SMaterial_List
{
	int						materialCount;
	vector<SMaterRial>		materialInfo;
};

struct	Index
{
	DWORD	dwIndex[3];
};

struct	SMesh
{	
	int					numVertex;
	int					numFace;
	vector<D3DXVECTOR3>	vertexPList;
	vector<Index>		facePList;
	vector<int>			subMtlid;

	int					numTVertex;	
	vector<D3DXVECTOR2>	vertexTList;
	int					numTface;
	vector<Index>		faceTList;

	int					numCVertex;
	vector<D3DXVECTOR3>	vertexCList;
	int					numCface;
	vector<Index>		faceCList;

	vector<D3DXVECTOR3>	faceNormal;
	vector<D3DXVECTOR3>	vertexNormal;
};

struct	SGeomObject
{
	TCHAR				nodeName[256];
	D3DXMATRIX			nodeTm;
	SMesh				meshInfo;
	int					materialRef;
};

class SObject
{
public :
	SParser			m_parser;

public :	
	SScene			scene;
	SMaterial_List	m_Material_List;
	SGeomObject		m_geomObject;
	SMaterRial		m_Material;

public :
	bool		LoadFile( TCHAR* strFilename );
	void		GetScene();
	void		GetMaterial();
	void		GetGeomObject();

	void		GetMeshInfo();	
	void		GetPVertexFace();
	void		GetTVertexFace();
	void		GetCVertexFace();	
	void		GetFaceVertexNormal();

	void		GetMaterialRef();
	

public :
	bool		Init();
	bool		Render();
	bool		Frame();
	bool		Release();

public:
	SObject(void);
	~SObject(void);

};